package com.vinoxm.common.auth.server.resource.service;

import com.vinoxm.common.auth.server.resource.dao.AuthDao;
import com.vinoxm.common.auth.server.resource.model.AuthResource;
import com.vinoxm.common.auth.server.resource.model.AuthUri;
import com.vinoxm.common.auth.server.resource.model.AuthUser;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AuthService {

    @Setter(onMethod_ = {@Autowired})
    private AuthDao authDao;

    public AuthResource getResourceRoles(String resourceId) {
        return authDao.selResourceById(resourceId);
    }

    public List<AuthUri> getResourceUri(String resourceId) {
        return authDao.selUriByResourceId(resourceId);
    }

    public AuthUser getUser(long userId) {return authDao.selUserById(userId);}
}
